package www.woniuxy.com.class112.util;

import lombok.Data;

@Data
public class Result {
    private String code;
    private String message;
    private Object data;

    public Result(String code,String message,Object data){
        this.code=code;
        this.message=message;
        this.data=data;
    }
    public static Result success(String message, Object data){
        return new Result("200",message,data);
    }

    public static Result fail(String message, Object data){
        return new Result("500",message,data);
    }

    public static Result noLogin(){
        return new Result("401","未登录","");
    }

    public static Result noPermission(){
        return new Result("402","权限不足","");
    }
}
